package com.fy56.platform.logistics.dbutil;

/**
 * @author li
 * @date 2018-03-08 13:02
 */
public class DataSourceTypeManager {
    private static final ThreadLocal<LogisticsDataSources> dataSourceTypes = new ThreadLocal<LogisticsDataSources>(){
        @Override
        protected LogisticsDataSources initialValue(){
            return LogisticsDataSources.MASTER;
        }
    };

    public static LogisticsDataSources get(){
        return dataSourceTypes.get();
    }

    public static void set(LogisticsDataSources dataSourceType){
        dataSourceTypes.set(dataSourceType);
    }

    public static void reset(){
        dataSourceTypes.set(LogisticsDataSources.MASTER);
    }
}
